package com.aim.util;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * User: Avraham Shvartzon
 * Date: 6/5/14
 */
public class HashMapOfList<K,V> extends HashMap<K, List<V>>{

    public boolean put(K k, V v){
        List<V> vs = get(k);
        if (vs == null){
            vs = new ArrayList<V>();
            put(k, vs);
        }
        return vs.add(v);
    }
}
